<{include file="admin:common/header.html"}>
<div class="page-title">
	<table width="100%" align="center" cellpadding="0" cellspacing="0" >
		<tr>
			<td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
			<th><{$MOD.title}>&nbsp;&nbsp;(商铺:<b class="red"><{$shop.title}></b>)</th>
			<td align="right"><{link ctl="shop/shop:index" class="button" title="返回商铺列表"}></td>
			<td width="15"></td>
		</tr>
	</table>
</div>
<div class="page-data">	
	<div class="tip-notice">
    <{if $pager.count<5}>
		<div class="SWF_Widget" rel="__SWF_Widget" params='{"submit":"true","shop_id":"<{$shop.shop_id}>","OATOKEN":"<{$OATOKEN}>"}'>
			<span rel="__SWF_ctl" class="SWF_Ctl" style="float:left;">控件加载中...</span>
			<span style="display:none;" class="SWF_Loading" rel="l"><span rel="m"></span><span rel="n"></span></span>
		</div>
    <{else}>
        <b class="red">每个商品最多可以上传5张相册图片</b>
    <{/if}>
	</div>
	<form id="items-form">
    <table width="100%" border="0" cellspacing="0" class="table-data table">
    <tr><th class="w-100">ID</th><th class="w-50">图片</th><th>标题</th><th>连接</th><th class="w-50">排序</th><th class="w-50">操作</th></tr>
    <{foreach $items as $item}>
    <tr><td><label><input type="checkbox" value="<{$item.banner_id}>" name="banner_id[]" CK="PRI"/><{$item.banner_id}><label></td>
    <td><img src="<{$pager.img}>/<{$item.photo}>" class="wh-50" photo="<{$pager.img}>/<{$item.photo}>" /></td>
    <td><input type="text" name="data[<{$item.banner_id}>][title]" value="<{$item.title}>" class="input w-200"/></td>
    <td><input type="text" name="data[<{$item.banner_id}>][link]" value="<{$item.link}>" class="input w-200"/></td>
    <td><input type="text" name="data[<{$item.banner_id}>][orderby]" value="<{$item.orderby}>" class="input w-50"/></td>    
    
<td><{link ctl="shop/banner:delete" args=$item.banner_id act="mini:删除" confirm="mini:确定要删除吗？" title="删除" class="button"}></td>
    </tr>
    <{foreachelse}>
     <tr><td colspan="20"><p class="text-align tip-notice">没有数据</p></td></tr>
    <{/foreach}>
    </table>
	</form>
    <div class="page-bar">
        <table>
            <tr>
            <td class="w-100"><label><input type="checkbox" CKA="PRI"/>&nbsp;&nbsp;全选</label></td>
            <td colspan="10" class="left">
                <{link ctl="shop/banner:delete" type="button" submit="mini:#items-form" confirm="mini:确定要批量删除选中的内容吗?" priv="hide" value="批量删除"}>
                <{link ctl="shop/banner:update" type="button" submit="mini:#items-form" priv="hide" value="批量更新"}>
            </td>
            <td class="page-list"><{$pager.pagebar}></td>
        </tr>
        </table>
    </div>    
</div><br/>
<{if $pager.count<5}>
<script src="<{$pager.res}>/swfupload/swfupload.js" type="text/javascript"></script>
<script src="<{$pager.res}>/script/kt.upload.js" type="text/javascript"></script>
<script type="text/javascript">
(function(K, $){
$(document).ready(function(){
var Events = {
	upload_all_complete : function(event,files){
		Widget.MsgBox.success("全部图片上传完成！");
		window.location.reload(true);
	}
};
$("div[rel='__SWF_Widget']").each(function(){
	$(this).SWFUpload({
		file_size_limit	: "10 MB",
		file_upload_limit : <{5-$pager.count}>,
		upload_url: "?shop/banner-upload.html",
		file_types : "*.jpg;*.gif;*.jpeg;*.png;",
		file_types_description : "添加图片",
		flash_url : "<{$pager.res}>/swfupload/swfupload.swf",
		button_image_url : "<{$pager.res}>/swfupload/photo.jpg",
		button_placeholder :$("[rel='__SWF_ctl']",this)[0],
		button_width: 84,
		button_height: 24,
		events:Events,
		debug : false
	});
});
});
})(window.KT, window.jQuery)
</script>
<{/if}>
<{include file="admin:common/footer.html"}>